for (name, info) in deviceConfig:
if name == 'vbd':
uname = sxp.child_value(info, 'uname')
- if 'file:' in uname:
+ if uname is not None and 'file:' in uname:
(_, vbdparam) = string.split(uname, ':', 1)
if not os.path.isfile(vbdparam):
raise VmError('Disk image does not exist: %s' %
except ValueError:
dev_type = "disk"
- try:
- (typ, params) = string.split(uname, ':', 1)
- except ValueError:
- (typ, params) = ("", "")
+ if uname is None:
+ if dev_type == 'cdrom':
+ (typ, params) = ("", "")
+ else:
+ raise VmError(
+ 'Block device must have physical details specified')
+ else:
+ try:
+ (typ, params) = string.split(uname, ':', 1)
+ except ValueError:
+ (typ, params) = ("", "")
+
back = { 'dev' : dev,
'type' : typ,
'params' : params,